package com.guida.dao;

import com.guida.domain.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    @Select("select * from user where user_email = #{email} AND user_password = #{password} AND user_status = '1';")
    @Results(id = "userMap", value = {
            @Result(id = true, column = "user_id", property = "id"),
            @Result(id = true, column = "user_name", property = "name"),
            @Result(id = true, column = "user_password", property = "password"),
            @Result(id = true, column = "user_email", property = "email"),
            @Result(id = true, column = "user_role", property = "role"),
            @Result(id = true, column = "user_status", property = "status")

    })
    User login(User user);
    /**
     * 管理系统中所有的Mapper接口查询都是基于注解@Select实现的，其他方法都通过Mapper映射
     */
}
